package org.glorylight.hacks.social.model;

import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;

@Entity
@Table(name = "scrap_comments")
//@NamedQueries({
//	@NamedQuery(name = "find-comments-by-scrap-voter", query = "from ScrapBookComments a where a.scrapbook = :scrapId and voter = :voter")
//})
public class ScrapBookComments implements Serializable {

	private static final long serialVersionUID = 9166072146100016226L;

	@Id
	@Type(type = "uuid")
	@Column(length = 32)
	private UUID uuid;

	@ManyToOne
	@JoinColumn(name = "scrapbook_id")
	private ScrapBook scrapBook;

	private Voter voter;

	@Column(name = "comment")
	private String comment;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dateCreated")
	private Date dateCreated;

	public ScrapBookComments() {
	}

	public ScrapBookComments(UUID uuid, ScrapBook scrapBook, Voter voter,
			String comment, Date dateCreated) {
		this.uuid = uuid;
		this.scrapBook = scrapBook;
		this.voter = voter;
		this.comment = comment;
		this.dateCreated = dateCreated;
	}

	public UUID getUuid() {
		return uuid;
	}

	public void setUuid(UUID uuid) {
		this.uuid = uuid;
	}

	public ScrapBook getScrapBook() {
		return scrapBook;
	}

	public void setScrapBook(ScrapBook scrapBook) {
		this.scrapBook = scrapBook;
	}

	public Voter getVoter() {
		return voter;
	}

	public void setVoter(Voter voter) {
		this.voter = voter;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

}
